Optimal. Leaf size=161 \[ -\frac {16 a^2 \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{5 d}+\frac {4 a^2 \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{3 d}+\frac {16 a^2 \sqrt {\sec (c+d x)} \sin (c+d x)}{5 d}+\frac {4 a^2 \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{3 d}+\frac {2 a^2 \sec ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{5 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 161, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 7, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.304, Rules used = {3317, 3873,
3853, 3856, 2720, 4131, 2719} \begin {gather*} \frac {2 a^2 \sin (c+d x) \sec ^{\frac {5}{2}}(c+d x)}{5 d}+\frac {4 a^2 \sin (c+d x) \sec ^{\frac {3}{2}}(c+d x)}{3 d}+\frac {16 a^2 \sin (c+d x) \sqrt {\sec (c+d x)}}{5 d}+\frac {4 a^2 \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{3 d}-\frac {16 a^2 \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{5 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2719
Rule 2720
Rule 3317
Rule 3853
Rule 3856
Rule 3873
Rule 4131
Rubi steps
\begin {align*} \int (a+a \cos (c+d x))^2 \sec ^{\frac {7}{2}}(c+d x) \, dx &=\int \sec ^{\frac {3}{2}}(c+d x) (a+a \sec (c+d x))^2 \, dx\\ &=\left (2 a^2\right ) \int \sec ^{\frac {5}{2}}(c+d x) \, dx+\int \sec ^{\frac {3}{2}}(c+d x) \left (a^2+a^2 \sec ^2(c+d x)\right ) \, dx\\ &=\frac {4 a^2 \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{3 d}+\frac {2 a^2 \sec ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{5 d}+\frac {1}{3} \left (2 a^2\right ) \int \sqrt {\sec (c+d x)} \, dx+\frac {1}{5} \left (8 a^2\right ) \int \sec ^{\frac {3}{2}}(c+d x) \, dx\\ &=\frac {16 a^2 \sqrt {\sec (c+d x)} \sin (c+d x)}{5 d}+\frac {4 a^2 \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{3 d}+\frac {2 a^2 \sec ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{5 d}-\frac {1}{5} \left (8 a^2\right ) \int \frac {1}{\sqrt {\sec (c+d x)}} \, dx+\frac {1}{3} \left (2 a^2 \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx\\ &=\frac {4 a^2 \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{3 d}+\frac {16 a^2 \sqrt {\sec (c+d x)} \sin (c+d x)}{5 d}+\frac {4 a^2 \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{3 d}+\frac {2 a^2 \sec ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{5 d}-\frac {1}{5} \left (8 a^2 \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \sqrt {\cos (c+d x)} \, dx\\ &=-\frac {16 a^2 \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{5 d}+\frac {4 a^2 \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{3 d}+\frac {16 a^2 \sqrt {\sec (c+d x)} \sin (c+d x)}{5 d}+\frac {4 a^2 \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{3 d}+\frac {2 a^2 \sec ^{\frac {5}{2}}(c+d x) \sin (c+d x)}{5 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 4 in
optimal.
time = 1.86, size = 261, normalized size = 1.62 \begin {gather*} \frac {a^2 (1+\cos (c+d x))^2 \sec ^4\left (\frac {1}{2} (c+d x)\right ) \left (-\frac {2 i \sqrt {2} e^{-i (c+d x)} \sqrt {\frac {e^{i (c+d x)}}{1+e^{2 i (c+d x)}}} \left (12 \left (1+e^{2 i (c+d x)}\right )+12 \left (-1+e^{2 i c}\right ) \sqrt {1+e^{2 i (c+d x)}} \, _2F_1\left (-\frac {1}{4},\frac {1}{2};\frac {3}{4};-e^{2 i (c+d x)}\right )+5 e^{i (c+d x)} \left (-1+e^{2 i c}\right ) \sqrt {1+e^{2 i (c+d x)}} \, _2F_1\left (\frac {1}{4},\frac {1}{2};\frac {5}{4};-e^{2 i (c+d x)}\right )\right )}{-1+e^{2 i c}}+\sqrt {\sec (c+d x)} (24 \cos (d x) \csc (c)+(10+3 \sec (c+d x)) \tan (c+d x))\right )}{30 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(385\) vs.
\(2(189)=378\).
time = 0.28, size = 386, normalized size = 2.40
method | result | size |
default | \(-\frac {8 \sqrt {-\left (-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, a^{2} \left (-\frac {4 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )}{5 \sqrt {-\left (-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}}+\frac {17 \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{30 \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}}-\frac {2 \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1}\, \left (\EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-\EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )\right )}{5 \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}}-\frac {\cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}}{80 \left (-\frac {1}{2}+\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}-\frac {\cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}}{12 \left (-\frac {1}{2}+\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}\right )}{\sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d}\) | \(386\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 0.15, size = 202, normalized size = 1.25 \begin {gather*} -\frac {2 \, {\left (5 i \, \sqrt {2} a^{2} \cos \left (d x + c\right )^{2} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) - 5 i \, \sqrt {2} a^{2} \cos \left (d x + c\right )^{2} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) + 12 i \, \sqrt {2} a^{2} \cos \left (d x + c\right )^{2} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) - 12 i \, \sqrt {2} a^{2} \cos \left (d x + c\right )^{2} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right ) - \frac {{\left (24 \, a^{2} \cos \left (d x + c\right )^{2} + 10 \, a^{2} \cos \left (d x + c\right ) + 3 \, a^{2}\right )} \sin \left (d x + c\right )}{\sqrt {\cos \left (d x + c\right )}}\right )}}{15 \, d \cos \left (d x + c\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (\frac {1}{\cos \left (c+d\,x\right )}\right )}^{7/2}\,{\left (a+a\,\cos \left (c+d\,x\right )\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________